package com.tledu.dayatype;

public class DTDouble {
    public static void main(String[] args) {
        // float   4
        // double  8
        // 默认声明带小数的变量是double类型，把double设置给float类型就会报错

        // 不建议开发过程中进行强制转换, 可能会出现精度损失，并且数据可能会出问题
        float num1 = (float) 9999999999999990999999.9999999999999999;
        System.out.println(9999999999999990999999.9999999999999999);
        System.out.println(num1);

        float num2 = 123.456f;
        double num3 = 3.1415926;
        System.out.println(num2);
        System.out.println(num3);
    }
}
